﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class K8876
    {
        public K8876()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            InitializeComponent();
            SDSA = "8876";
        }
        public override void LOADALL()
        {
            base.LOADALL();
            foreach (DataRow row in TBMain.Rows)
            {
                row["SDES"] = Helpers.Helper.Convert8859P1ToGB2312(row["SDES"].ToString().Trim());
                row["DES"] = Helpers.Helper.Convert8859P1ToGB2312(row["DES"].ToString().Trim());
            }
            if (SDSA.Length == 0) return;
            if (TBMain.Rows.Count > 0)
                return;
            if (DBSDDAT.ContainsKey(SDSA))
            {
                DBSDDAT.Remove(SDSA);
            }
            dwData = TBMain.NewRow();
            TMV.SetUpNewRow(ref dwData, SDSA);
            dwData["KEY"] = "J";
            dwData["DES"] =Helpers.Helper.ConvertGB2312To8859P1("可输");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("可输");
            dwData["VALUE"] = "000000000"; 
            TMV.Save(dwData);
            dwData["KEY"] = "P";
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("必输");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("必输");
            dwData["VALUE"] = "000000000";

            TMV.Save(dwData);
            dwData["KEY"] = "N";
            dwData["DES"] = Helpers.Helper.ConvertGB2312To8859P1("不输");
            dwData["SDES"] = Helpers.Helper.ConvertGB2312To8859P1("不输");
            dwData["VALUE"] = "000000000";

            TMV.Save(dwData);
            LOADALL();
        }
    }
}
